package com.nosweattechnet.locationsearch;

import com.nosweattechnet.mapmyway.R;

import android.content.Intent;
import android.location.Criteria;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.support.v4.app.NavUtils;

//Searches for Places with a radius specified in the intent used to start the activity
public class GivenLocationSearchActivity extends SuperLocationSearchActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Intent intent=this.getIntent();
        float radius=intent.getFloatExtra(getString(R.string.radius_intent),0);
        radiusSearch(radius);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_set_location_search, menu);
        return true;
    }
    
    protected Criteria getCriteria(){
    	return new Criteria();
    }
    
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case android.R.id.home:
                NavUtils.navigateUpFromSameTask(this);
                return true;
        }
        return super.onOptionsItemSelected(item);
    }

}
